<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>运动健身</title>
		<link rel="stylesheet" type="text/css" href="js/bootstrap/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="js/font-awesome/css/font-awesome.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/lxm.css" />
		<script src="js/common/jquery-1.12.2.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript"  src="js/common/baseUrl.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
		<script type="text/javascript" src="js/artTemplate/template.js"></script>
		<script type="text/javascript" src="js/common/fitness.js"></script>
         
	</head>

		</div>
		<div class="searchBox">
			<div class="search">
				<div class="search-left">
					<h3>互生 <small>休闲娱乐</small></h3>
				</div>
				<div class="search-right">
					<div class="one">
						<input type="text" name="search" id="search" value="输入商家名称、分类或地区" placeholder="输入商家名称、分类或地区" />
						<a href="javascript:void(0)">
							<i class="fa fa-search"></i>
						</a>
					</div>

					<div class="two">
						<a href="#">运动健身</a>
						<a href="#">瑜伽</a>
						<a href="#">羽毛球</a>
						<a href="#">CS</a>
						<a href="#">农家乐</a>
						<a href="#">私人影院</a>
					</div>
				</div>

			</div>

		</div>

	</div>

	<!-- template开始 -->
	<!--主要内容-->
	<div id="content" class="fitness"></div>
	<div id="content2" class="fitness"></div>
	<div id="content3" class="fitness"></div>

	<script id="test" type="text/html">
		<!--当前页-->
		<p class="current">首页>休闲娱乐><a href="#">运动健身</a></p>
		<!--简介-->
		<div class="jianjie">
			<div class="name">
				<h4>
					<a href="#">{{isAll.entName}} </a>
					<img src="img/huizhang.png" />
					<i class="fa fa-comments"></i>
				</h4>
				<p class="caozuo">
					<span>
						<i class="fa fa-heart-o"></i>关注
					</span>
					<span>
						<i class="fa fa-share-square-o"></i>分享
					</span>
				</p>
			</div>
			<div class="list">
				<div class="list-left">
					<p>{{isAll.entResno}}</p>
					<div class="pingfen">
						<div>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
						</div>
						<span>{{isAll.shopEvaluateValue}}分</span>
						<span>{{isAll.cityName}}</span>
					</div>
					<div class="three">
						<div class="three-address">
							{{isAll.addres}}({{isAll.area}})
							<i class="fa fa-map-marker"></i>
							<a href="#">[查看地图]</a>
						</div>
						<div class="three-time">
							<span>
								营业时间：
							</span>
							<p>
								<!-- <span>
									周一至周五： 11:00-22:00
								</span> <br />
								<span>
									周一至周五： 11:00-22:00
								</span> -->
								{{each isWeek value}}
									<span>
										{{value.startWeek}}至{{value.endWeek}}： {{value.startTime}}-{{value.endTime}}
									</span><br />
								{{/each}}
							</p>
						</div>
						<div class="three-time">
							<span>
								商家电话:
							</span>
							<button>登录可看</button>
							<!--<p>0755-81234567</p>-->
						</div>
					</div>
					<div class="tese">
						{{each isAll.facilitie faci}}
							<p>
								<img src="{{isUrl}}{{faci.facilityUrl}}" /> {{faci.facilityName}}
							</p>
						{{/each}}
					</div>
				</div>
				<div class="list-right">
					<div class="imgBox">
						<img src="{{isAll.shopPictures[0]}}" />
						<div class="allpic">
							<img src="img/pic.png" alt="">
							<span>{{isAll.shopPictures.length}}</span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--优惠券-->
		<div class="youhuiquan">
				<div class="yhq-one">
					<h4>商家优惠券</h4>
					<a href="javascript:void(0)" data-toggle="modal" data-target="#myModal">更多优惠券></a>
				</div>
				<div class="yhq-two">
					<ul>
						{{each isAll.result.data value}}
						<li>
							<div class="yhqbox">
								<div class="yhq-left">
									<h4><small>¥ </small>{{value.couponAmount}}</h4>
									<span>满{{value.canUseAmount}}元可用</span>
								</div>
								<div class="yhq-right">
									<h4>{{value.shopName}}</h4>
									<p>使用范围：{{each value.category area}}{{area}} {{/each}}</p>
									<div>
										<span>{{value.useStartTime}}-{{value.useExpireTime}}</span>
										<button>点击领取</button>
									</div>
								</div>
							</div>
						</li>
						{{/each}}
					</ul>
				</div>
			</div>
			<!--优惠券-->
			<!--服务项目-->
		
		<div class="project">
				<h4>服务项目</h4>
				<ul>
					{{each isAll.basicInfos value}}
					<li>
						<div class="left">
							<img src="{{isUrl}}{{value.goodsImg.split(',')[0]}}" />
						</div>
						<div class="right">
							<h4>{{value.goodsName}} {{if value.serviceType==1}}<a href="#">上门</a>{{/if}}</h4>
							<div>
								<p>
									<img src="img/yhq2.png" /> <strong>{{value.hsprice}}</strong>
								</p>
								<p>
									<img src="img/yhq3.png" />
									<span>{{value.perPoint}}</span>
								</p>
								<p>已售{{value.totalSaleCount}}</p>
								{{if value.serviceType==3}}<a href="javascript:void(0)">立即购买</a>{{else if value.serviceType!=3}}<a href="yuyue.html" class="yuyueBtn">立即预约</a>{{/if}}
							</div>
							<p>
								<img src="img/yhq1.png" /> 每满{{value.hscouponUseRule.split(':')[0]}}元可使用{{value.hscouponUseRule.split(':')[1]}}元抵用券1张
							</p>
						</div>
					</li>
					{{/each}}
				</ul>
			</div>
			<!--服务项目-->
			
		<!--服务人员-->
		<div class="staff">
				<div class="staff-top">
					<h4>服务人员</h4>
					<a href="javascript:void(0)" data-toggle="modal" data-target="#moreStaff">更多服务人员 <i
							class="fa fa-angle-right"></i> </a>
				</div>
				<ul>
					{{each isAll.tbasicStaffs value}}
					<li>
						<div class="li-left">
							<img src="{{isUrl}}{{value.headUrl}}" />
						</div>
						<div class="li-right">
							<h4>{{value.jobName}}</h4>
							<span>{{value.servicePost}}</span>
							<p>
								{{if value.sex==0}}<span>女</span>{{else if value.sex==1}}<span>男</span>{{/if}}
								<span>{{value.age}}岁</span>
								<span>从业{{value.workedYears}}年</span>
							</p>
						</div>
					</li>
					{{/each}}
				</ul>
			</div>
			<!--服务人员-->
			<!-- 更多优惠券模态框开始 -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							更多优惠券
						</h4>
					</div>
					<div class="modal-body moreYhq">
						<ul>
							{{each isAll.result.data value}}
							<li>
								<div class="yhqbox">
									<div class="yhq-left">
										<h4><small>¥ </small>{{value.couponAmount}}</h4>
										<span>满{{value.canUseAmount}}元可用</span>
									</div>
									<div class="yhq-right">
										<h4>{{value.shopName}}</h4>
										<p>使用范围：教育</p>
										<div>
											<span>{{value.useStartTime}}-{{value.useExpireTime}}</span>
											<button>点击领取</button>
										</div>
									</div>
								</div>
							</li>
							{{/each}}
						</ul>
					</div>
	
				</div>
				<!-- /.modal-content -->
			</div>
		</div>
		<!-- 更多优惠券模态框结束 -->
		<!-- 更多服务人员模态框开始 -->
		<div class="modal fade" id="moreStaff" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
			aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							更多服务人员
						</h4>
					</div>
					<div class="modal-body moreStaff">
						<ul>
							{{each isAll.tbasicStaffs value}}
							<li>
								<div class="li-left">
									<img src="img/userhead.png" />
								</div>
								<div class="li-right">
									<h4>{{value.jobName}}</h4>
									<span>{{value.servicePost}}</span>
									<p>
										{{if value.sex==0}}<span>女</span>{{else if value.sex==1}}<span>男</span>{{/if}}
										<span>{{value.age}}岁</span>
										<span>从业{{value.workedYears}}年</span>
									</p>
								</div>
							</li>
							{{/each}}
						</ul>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>
		</div>
		<!-- 更多服务人员模态框结束 -->
	</script>
	<script id="test2" type="text/html">
		<!--用户评价-->
		<div class="comments">
			<div class="com-top">
				<h4>用户评价</h4>
				<!--<button>写点评</button>-->
			</div>
			<div class="com-point">
				<h4>{{isEvaNums.pingfen}}</h4>
				<div class="point-det">
					<span>综合评分</span>
					{{if isEvaNums.pingfen>0&&isEvaNums.pingfen<=1.4}}
						<p>
							<i class="fa fa-star"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
						</p>
						{{else if isEvaNums.pingfen>1.4&&isEvaNums.pingfen<=2.4}}
						<p>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
						</p>
						{{else if isEvaNums.pingfen>2.4&&isEvaNums.pingfen<=3.4}}
						<p>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star-o"></i>
							<i class="fa fa-star-o"></i>
						</p>
						{{else if isEvaNums.pingfen>3.4&&isEvaNums.pingfen<=4.4}}
						<p>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star-o"></i>
						</p>
						{{else if isEvaNums.pingfen>4.4}}
						<p>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
							<i class="fa fa-star"></i>
						</p>
					{{/if}}
				</div>
				<div class="rate">
					<span>好评率{{isEvaNums.evaluateValue}}</span>
				</div>
			</div>
			<div class="com-category">
				<span onclick="ssss('全部')">全部({{isEvaNums.nums}})</span>
				<span onclick="ssss('好评')">好评({{isEvaNums.goodsV}})</span>
				<span onclick="ssss('差评')">差评({{isEvaNums.badV}})</span>
				<span onclick="ssss('有图')">有图({{isEvaNums.hasPic}})</span>
			</div>
		</div>
		<!--用户评价-->
	</script>
	<script id="test3" type="text/html">
		<!--用户评价-->
		<div class="comments">
			<div class="tabChange">
				<ul class="comments-lists">
					{{each isEvaCon value}}
					<li>
						<div class="left">
							<img src="{{isUrl}}{{value.userHeadUrl}}" />
						</div>
						<div class="center">
							<p>{{value.userName}}</p>

							{{if value.evaluateValue>0&&value.evaluateValue<=1.4}}
								<p>
									<i class="fa fa-star"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
								</p>
								{{else if value.evaluateValue>1.4&&value.evaluateValue<=2.4}}
								<p>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
								</p>
								{{else if value.evaluateValue>2.4&&value.evaluateValue<=3.4}}
								<p>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star-o"></i>
									<i class="fa fa-star-o"></i>
								</p>
								{{else if value.evaluateValue>3.4&&value.evaluateValue<=4.4}}
								<p>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star-o"></i>
								</p>
								{{else if value.evaluateValue>4.4}}
								<p>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
									<i class="fa fa-star"></i>
								</p>
							{{/if}}

							<p>{{value.evaluateContent}}</p>
							<div>
								{{each value.evaluateImgs evaPic}}
									<img src="{{isUrl}}{{evaPic}}" />
								{{/each}}
							</div>
							<div class="xiangguan">
								<img src="{{isUrl}}{{value.goodsImg}}" alt="" />
								<div>
									<h4>{{value.goodsName}}</h4>
									<p>{{value.goodsAdvantage}}</p>
								</div>
							</div>
							<div class="huifu">
								<strong>商家回复：</strong>
								<span>{{value.reply}}</span>
							</div>
						</div>
						<div class="right">{{value.evaluateTime}}</div>
					</li>
					{{/each}}
				</ul>
			</div>

			<a class="more" onclick="pushData('{{evaluate}}')">查看更多评价
				<i class="fa fa-caret-down"></i>
			</a>

		</div>
		<!--用户评价-->
	</script>
	<!-- template结束 -->
	<!--尾部-->
	<div class="foot" id="foot">
		<p>
			<strong>客服热线： </strong>
			<a href="javascript:void(0)">
				0755-83344111
			</a>
			<span class="foot-adition">2013-2018 </span>
			<span>
				深圳市互生电子商务有限公司
			</span>
			<span>
				粤ICP备案号14100052号
			</span>
		</p>
	</div>

	<script type="text/javascript">
		// $('.com-category span').each(function (index) {
		// 	$(this).click(function () {
		// 		$(this).css({
		// 			'background': 'rgb(35,106,173)',
		// 			'color': '#fff'
		// 		}).siblings().css({
		// 			'background': '#fff',
		// 			'color': 'rgb(16,16,16)'
		// 		})
		// 		$('.comments .tabChange ul:eq(' + index + ')').css({
		// 			'display': 'block'

		// 		}).siblings().css({
		// 			'display': 'none'
		// 		})
		// 	})
		// })
	</script>

	<script>
		var isShopId = "0600400007120190215";
		// 默认显示几条评价
		var showCon = [];
		var evaCon = [];

		// 店铺信息
		$(function () {
			$.ajax({
				type: "get",
				url: baseUrl + "hsent-xxyl-user/store/SelectMerchantDetails",
				dataType: "json",
				data: {
					shopId: isShopId
				},
				success: function (res) {
					// console.log("这是店铺信息");
					// console.log(res);
					allData = res.data;
					// 好评率
					allEva = res.evaluate;
					// 好评总数
					allTotal = res.total;
					allWeek = res.data.week;
					var data = {
						isAll: allData,
						isEva: allEva,
						isTotal: allTotal,
						isWeek: allWeek,
						isUrl: picUrl
					};
					var html = template('test', data);
					document.getElementById('content').innerHTML = html;
				},
				error: function (msg) {

				}
			})
		})

		// 评价数量
		$(function () {
			$.ajax({
				type: "get",
				url: baseUrl + "/hsent-xxyl-user/store/selectNums",
				dataType: "json",
				data: {
					shopId: isShopId
				},
				success: function (res) {
					// console.log("这是评价数量");
					// console.log(res);
					evaNums = res.data;
					var data = {
						isEvaNums: evaNums
					};
					var html = template('test2', data);
					document.getElementById('content2').innerHTML = html;
				},
				error: function (msg) {

				}
			});
		});

		// 评价内容
		// 评价类型
		var type = "全部";
		// 分页
		var page = 1;
		// 每页显示条数
		var index = 2;
		var dataPingjia = {
			// isEvaCon: [],
			isUrl: picUrl,
			evaluate:''
		};

		function ssss(type) {
			// console.log(type);
			page = 1;
			$.ajax({
				async: false,
				type: "get",
				url: baseUrl + "/hsent-xxyl-user/store/SelectAllEvaluation",
				dataType: "json",
				data: {
					page: page,
					index: index,
					shopId: isShopId,
					status: type
				},
				success: function (res) {
					// console.log("这是全部好评差评有图");
					// console.log(res);
					// 所有评价
					dataPingjia.isEvaCon = res.data;
					dataPingjia.evaluate = res.evaluate;
					// console.log(dataPingjia);
					var html = template('test3', dataPingjia);
					document.getElementById('content3').innerHTML = html;
				},
				error: function (msg) {

				}
			})
		}
		ssss("全部");
		
		function pushData(leixing) {
			page++;
			
			$.ajax({
				async: false,
				type: "get",
				url: baseUrl + "/hsent-xxyl-user/store/SelectAllEvaluation",
				dataType: "json",
				data: {
					page: page,
					index: index,
					shopId: isShopId,
					status: leixing
				},
				success: function (res) {
					// console.log("这是全部好评差评有图");
					// console.log(res);
					// 所有评价
					dataPingjia.isEvaCon = dataPingjia.isEvaCon.concat(res.data);
					// console.log(dataPingjia.isEvaCon );
					var html = template('test3', dataPingjia);
					document.getElementById('content3').innerHTML = html;
				},
				error: function (msg) {

				}
			})

		}
	</script>
</body>

</html>